#include<bits/stdc++.h>
using namespace std;

int main()
{
	string s1,s2,s3,s4;
	cin>>s1>>s2>>s3>>s4;
	
	vector<string> arr(4);
	arr[0] = s1,arr[1] = s2,arr[2] = s3,arr[3] = s4;
	string max;
	for(int i = 0;i<=3;i++)
	{
		for(int j = 0;j<=3;j++)
		{
			for(int k = 0;k<=3;k++)
			{
				for(int l = 0;l<=3;l++)
				{
					if(i!=j&&i!=k&&i!=l&&j!=k&&j!=l&&k!=l)
					{
						string tmp;
						tmp+= arr[i];
						tmp+=arr[j];
						tmp+=arr[k];
						tmp+=arr[l];
						if(strcmp(tmp.c_str(),max.c_str()))
						{
							max = tmp;
						}
					}	
				}
				
			}
		}
	}
	cout<<max<<endl;
	return 0;
}
